import java.util.zip.CheckedOutputStream;

public class Test {
    public static void main(String[] args) {
        int end=100;
        int count=0;
        boolean[] flag=new boolean[101];
        int[] number=new int[101];
        int cnt=0;
        for(int i=2;i<=end;++i){
            if(flag[i]==false){
                number[cnt++]=i;
            }
            for(int j=0;j<cnt && number[j]*i<=end;++j){
                flag[i*number[j]]=true;
                if(i%number[j]==0){
                    break;
                }
                ++count;
            }
        }
        System.out.println("|");
        for (int i = 0; i < cnt; i++) {
            System.out.print(number[i]+"|");
        }
        System.out.println();
        System.out.println("运算了"+(count+cnt+end-2+1)+"次数");
    }
}
